import request from '@/utils/request'

const path = `ROUTE_PATH`

export async function list({ name, pageNum, pageSize }) {
  return request(`/admin${path}/list`, {
    method: 'GET',
    params: {
      name,
      pageNum,
      pageSize,
    },
  })
}

export async function add({ name, description }) {
  return request(`/admin${path}/add`, {
    method: 'POST',
    data: {
      name,
      description,
    },
  })
}

export async function edit({ id, name, description }) {
  return request(`/admin${path}/edit`, {
    method: 'POST',
    data: {
      id,
      name,
      description,
    },
  })
}

export async function remove({ ids }) {
  return request(`/admin${path}/remove`, {
    method: 'POST',
    data: {
      ids,
    },
  })
}
